package tacGen;

import java.util.Stack;

public class RegisterCounterStack {

	private Stack<RegisterCounter> stack;

	RegisterCounterStack() {
		stack = new Stack<RegisterCounter>();
	}

	public int size() {
		return stack.size();
	}

	public RegisterCounter pop() {
		RegisterCounter retval = null;
		if (!stack.isEmpty()) {
			retval = stack.pop();
		}
		return retval;
	}

	public void push(RegisterCounter arg) {
		stack.push(arg);
	}

	public RegisterCounter peek() throws Exception {
		return stack.peek();
	}

}
